package com.design.config;


import com.design.model.menus.ErrorCode;

public class CommonException extends RuntimeException{
    private String code;
    private String message;

    public CommonException(String code, String message ){
        this.code = code;
        this.message = message;
    }

    public CommonException(String message ){
        this.code = "500";
        this.message = message;
    }

    public CommonException(ErrorCode errorCode){
        this.code = errorCode.getCode();
        this.message = errorCode.getMessage();
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    @Override
    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }
}
